<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>悠南山养老中心管理系统</title>
    <link rel="shortcut icon" href="${params.contextPath!}/static/img/favicon.ico" type="image/x-icon">
    <link rel="icon" href="${params.contextPath!}/static/img/favicon.ico" type="image/x-icon">

    <link rel="stylesheet" href="${params.contextPath!}/static/ui/css/bootstrap.min.css?_t=${params.pageRandom!}">
    <link rel="stylesheet" href="${params.contextPath!}/static/ui/css/materialdesignicons.min.css?_t=${params.pageRandom!}">
    <link rel="stylesheet" href="${params.contextPath!}/static/ui/css/style.min.css?_t=${params.pageRandom!}">
    <style>
        .lyear-wrapper {
            position: relative;
            background-image: url("${params.contextPath!}/static/img/bg.jpg");
            background-repeat: no-repeat;
            background-size: cover;
        }

        .lyear-login {
            display: flex !important;
            min-height: 100vh;
            align-items: center !important;
            justify-content: center !important;
        }

        .login-center {
            background: #fff;
            min-width: 38.25rem;
            padding: 2.14286em 3.57143em;
            border-radius: 5px;
            margin: 2.85714em 0;
        }

        .login-header {
            margin-bottom: 1.5rem !important;
        }

        .login-center .has-feedback.feedback-left .form-control {
            padding-left: 38px;
            padding-right: 12px;
        }

        .login-center .has-feedback.feedback-left .form-control-feedback {
            left: 0;
            right: auto;
            width: 38px;
            height: 38px;
            line-height: 38px;
            z-index: 4;
            color: #dcdcdc;
        }

        .login-center .has-feedback.feedback-left.row .form-control-feedback {
            left: 15px;
        }

        .popupDom {
            position: fixed;
            top: -40px;
            width: 100%;
            text-align: center;
        }

        .popup {
            width: 200px;
            height: 40px;
            line-height: 40px;
            background-color: #5FB878;
            border-radius: 0px 0px 4px 4px;
            text-align: center;
            margin: 0 auto;
            border: 1px solid #5FB878;
            border-top: none;
            color: #FFFFFF !important;
        }
    </style>
</head>

<body>
<div class="row lyear-wrapper">
    <div class="lyear-login">
        <div class="login-center">
            <div class="login-header text-center">
                <!--<a href="index.html"><img alt="light year admin" src="${params.contextPath!}/static/ui/images/logo-sidebar.png"> </a>-->
                <a href="${params.contextPath!}" style="font-size:28px;color:#33cabb;"> 悠南山养老中心管理系统 </a>
            </div>
            <form class="login-form" action="${params.contextPath!}/loginIn" method="post">
                <div class="form-group has-feedback feedback-left">
                    <input type="text" placeholder="请输入您的用户名" class="form-control" name="account" id="username"/>
                    <span class="mdi mdi-account form-control-feedback" aria-hidden="true"></span>
                </div>
                <div class="form-group has-feedback feedback-left">
                    <input type="password" placeholder="请输入密码" class="form-control" id="password" name="pass"/>
                    <span class="mdi mdi-lock form-control-feedback" aria-hidden="true"></span>
                </div>
                <!--<div class="form-group has-feedback feedback-left row">
                    <div class="col-xs-7">
                        <input type="text" name="captcha" class="form-control" placeholder="验证码">
                        <span class="mdi mdi-check-all form-control-feedback" aria-hidden="true"></span>
                    </div>
                    <div class="col-xs-5">
                        <img src="${params.contextPath!}/static/ui/images/captcha.png" class="pull-right" id="captcha"
                             style="cursor: pointer;" onclick="this.src=this.src+'?d='+Math.random();" title="点击刷新"
                             alt="captcha">
                    </div>
                </div>-->
                <div class="form-group">
                    <input class="btn btn-block btn-primary" type="submit" value="立即登录"/>
                </div>
            </form>
            <hr>
            <footer class="col-sm-12 text-center">
                <p class="m-b-0">Copyright © 2019 <a href="http://www.yunfeisoft.com">云飞工作室</a>. All right reserved</p>
            </footer>
        </div>
    </div>
    <div class="popupDom">
        <div class="popup text-default"></div>
    </div>
</div>
<script type="text/javascript" src="${params.contextPath!}/static/ui/js/jquery.min.js?_t=${params.pageRandom!}"></script>
<script type="text/javascript" src="${params.contextPath!}/static/ui/js/bootstrap.min.js?_t=${params.pageRandom!}"></script>
<script type="text/javascript">
    function popup_msg(msg) {
        $(".popupDom").css("top", "-40px");
        $(".popupDom").animate({
            "top": "0px"
        }, 400, function () {
            $(".popup").html(msg);
        });
        /*setTimeout(function () {
            $(".popupDom").animate({
                "top": "-40px"
            }, 400);
        }, 2000);*/
    }

    function isIE() {
        if (!!window.ActiveXObject || "ActiveXObject" in window) {
            return true;
        }
        return false;
    }

    function close_popup() {
        $(".popupDom").animate({
            "top": "-40px"
        }, 400);
    }

    /*动画（注册）*/
    $(document).ready(function (e) {
        /*if (isIE() || !window.applicationCache) {
            location.href = "browser.htm";
            return;
        }*/
        $("form").submit(function () {
            popup_msg("正在登录...");
            var account = $("[name='account']").val() || "";
            var pass = $("[name='pass']").val() || "";
            var yzmCode = $("[name='yzmCode']").val() || "";
            $('[type="submit"]').attr("disabled", "disabled");
            $.ajax({
                url:$(this).attr("action"),
                data:{account:account,pass:pass,yzmCode:yzmCode},
                type:"post",
                dataType:"json",
                async:true,
                success:function(data){
                    $('[type="submit"]').removeAttr("disabled");
                    close_popup();
                    if (data.success) {
                        location.href = "${params.contextPath!}/view/business/mobile/home.htm";
                        return;
                    }
                    popup_msg(data.message);
                    $("#yzmImage").click();
                    $("[name='yzmCode']").val("");
                }
            });
            return false;
        });
        $("#yzmImage").click(function () {
            var url = $(this).attr("data-src") + "?_t=" + new Date().getTime();
            $(this).prop("src", url);
        });
    });
</script>
</body>
</html>